package com.hsck.order.kds.base.utils

import android.view.View

// 扩展View类，添加防止暴力点击的方法
fun View.setOnSingleClickListener(interval: Long = 300, onClick: (View) -> Unit) {
    var lastClickTime = 0L
    setOnClickListener { view ->
        val currentTime = System.currentTimeMillis()
        if (currentTime - lastClickTime >= interval) {
            lastClickTime = currentTime
            onClick(view)
        }
    }
}